﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TestTcpSockets.Plugin.Interface;
using System.IO;

namespace TestTcpSockets.Plugin.System
{
    public class Boot : INabPlugin
    {
        #region INabPlugin Members

        public bool HandleRequest(byte[] rawrequest, string request, Stream reply)
        {
            if (request.Substring(8,6) == "bc.jsp")
            {
                string filename =
                    @"C:\Users\maxime.prat\Documents\Visual Studio 2010\Projects\NabNet\TestTcpSockets\bootc";
                using (Stream bc = new FileStream(filename, FileMode.Open))
                {
                    byte[] b = new byte[bc.Length];
                    bc.Read(b, 0, (int) bc.Length);

                    reply.Write(b, 0, b.Length);
                }
                return true;
            }
            return false;
        }

        #endregion
    }
}
